#ifndef COMMPREFS_GUI_H_
#define COMMPREFS_GUI_H_

#include <Etk.h>

/* Libsylph includes */
#include <sylph/sylmain.h>
#include <sylph/prefs_common.h>
#include <sylph/prefs.h>
#include <sylph/account.h>

typedef struct _Prefs_Page {
    // Widgets for Receive page
    int pageid;
} Prefs_Page;

typedef struct _Prefs_Page_Receive {
    // Widgets for Receive page
    int pageid;
    Etk_Widget *autocheck_every;
    Etk_Widget *autocheck_mins;
    Etk_Widget *check_startup;
    Etk_Widget *mail_command;
    Etk_Widget *command;
    Etk_Widget *command_label;
    Etk_Widget *vbox1, *vbox2;
    Etk_Widget *hbox;
} Prefs_Page_Receive;

typedef struct _Prefs_Page_Send {
	// Widgets for Send page
	int pageid;
	Etk_Widget *vbox;
	Etk_Widget *save_sent;
	Etk_Widget *apply_filters;
	Etk_Widget *label;
	Etk_Widget *trans_enc;
	Etk_Widget *mime_enc;
	Etk_Widget *hbox1, *hbox2;
} Prefs_Page_Send;

typedef struct _Prefs_Page_Compose_General_Page {
    // Widget for General page on Compose page
    int pageid;
    Etk_Widget *vbox;;
    Etk_Widget *sign_frm;
    Etk_Widget *sign_hbox;
    Etk_Widget *label;
    Etk_Widget *sign_sep;
    Etk_Widget *ins_auto;
    Etk_Widget *reply_frm;
    Etk_Widget *reply_vbox;
    Etk_Widget *auto_sel_acct;
    Etk_Widget *quote_msg;
    Etk_Widget *rply_ml_rply;
    Etk_Widget *inherit_on_rply;
} Prefs_Page_Compose_General_Page;

typedef struct _Prefs_Page_Compose_Editor_Page {
    // Widget for Editor page on Compose page
    int pageid;
    Etk_Widget *vbox;
    Etk_Widget *hbox1, *hbox2, *hbox3;
    Etk_Widget *label;
    Etk_Widget *auto_ext_ed;
    Etk_Widget *undo_spn;
    Etk_Widget *wrap_spn;
    Etk_Widget *wrap_quot;
    Etk_Widget *wrap_on_in;
    Etk_Widget *autosave;
    Etk_Widget *autosave_spn;
}Prefs_Page_Compose_Editor_Page ;

typedef struct _Prefs_Page_Compose_Format_Page {
    // Widget for Format page on Compose page
    int pageid;
    Etk_Widget *vbox;
    Etk_Widget *hbox1, *hbox2;
    Etk_Widget *label;
    Etk_Widget *reply_frm;
    Etk_Widget *reply_vbox;
    Etk_Widget *reply_qmark;
    Etk_Widget *reply_format;
    Etk_Textblock_Iter *reply_iter;
    Etk_Widget *fwd_frm;
    Etk_Widget *fwd_vbox;
    Etk_Widget *fwd_qmark;
    Etk_Widget *fwd_format;
    Etk_Textblock_Iter *fwd_iter;    
    Etk_Widget *hlp_btn;
}Prefs_Page_Compose_Format_Page ;

typedef struct _Prefs_Page_Compose_Spell_Page {
    // Widget for Spell page on Compose page
    int pageid;
}Prefs_Page_Compose_Spell_Page ;

typedef struct _Prefs_Page_Compose {
    // Widgets for Compose page
    int pageid;
    Etk_Widget *vbox;
    Etk_Widget *cmp_tabs;
    Etk_Widget *tabpage;
    Prefs_Page_Compose_General_Page *gen_p;
    Prefs_Page_Compose_Editor_Page *edit_p;
    Prefs_Page_Compose_Format_Page *fmt_p;
    Prefs_Page_Compose_Spell_Page *spell_p;
} Prefs_Page_Compose;

typedef struct _CommPrefs_Gui {
    // Main widgets
    Etk_Widget *win;
    Etk_Widget *mainvbox;	
    Etk_Widget *maintabs;
    Etk_Widget *tabpage;
    Etk_Widget *buttonshbox;
    Etk_Widget *buttons;
    Prefs_Page_Receive *rcv_p;
    Prefs_Page_Send *snd_p;
    Prefs_Page_Compose *cmp_p;
    Prefs_Page *compose_page;
    Prefs_Page *display_page;	
    Prefs_Page *junk_page;	
    Prefs_Page *privacy_page;
    Prefs_Page *details_page;	
} CommPrefs_Gui;

/* Common preference GUI callbacks */
void _commprefs_quit_cb(void *data);

/* The builder */ 
void build_commprefs_gui(void);

extern CommPrefs_Gui *cp_gui;
#endif /*COMMPREFS_GUI_H_*/
